package com.itheima.demo.demo10;

import java.io.*;
import java.util.HashMap;
import java.util.Map;

public class 出师表 {
    public static void main(String[] args) throws IOException {
          BufferedReader br=new BufferedReader(new FileReader("D:\\出师表.txt"));
           String len="";
           Map<String, String> map=new HashMap<>();
          while ((len=br.readLine())!=null){

               String[] split = len.split("\\.");

               map.put(split[0],split[1]);
          }
          br.close();
        BufferedWriter bw=new BufferedWriter(new FileWriter("D:\\新出师表"));
        for (int i = 1; i <=9 ; i++) {
            String s = String.valueOf(i);
            String value = map.get(s);
          bw.write(s+value);
            bw.newLine();


        }
            bw.close();
    }
}
